window.onload = function() {(window.onresize = function() {
    var width = document.documentElement.clientWidth - 180;         //获取main区域的自动适应宽度
    var height = document.documentElement.clientHeight - 80;        //获取sidebar和main区域的自动适应宽高度 
    if(width >= 0) document.getElementById('main').style.width = width + 'px';
    if(height >= 0) {
        document.getElementById('main').style.height = height + 'px';
        document.getElementById('sidebar').style.height = height + 'px';
    }
})();
}